/*
 * @Author: liyongxuan
 * @Date: 2018-04-26 14:36:37
 * @description: 事件-->企业财务信息
*/

import Api from '../../../api/event/eventFinanceController.api';
import ComApi from '../../../api/company/comFinanceController.api';
import { JsonResult, EventFinanceDto } from '../../../api/Interface';
import { apiHttp } from '../../apiHttp';
import { FinanceInEventDto, FinanceRateInEventDto } from '../Interface';


export default {
  // 根据事件Id获取标的企业财务信息
  getEventFinanceInfo: async (eventId: string): Promise<JsonResult> => {
    const res: JsonResult = await apiHttp(Api.getEventFinance, { eventId });
    return res;
  },
  // 添加标的企业财务信息
  saveEventFinanceInfo: async (eventFinanceDto: EventFinanceDto): Promise<JsonResult> => {
    const res: JsonResult = await apiHttp(Api.saveEventFinance, eventFinanceDto);
    return res;
  },
  // 修改标的企业财务信息
  updateEventFinance: async (eventFinanceDto: EventFinanceDto): Promise<JsonResult> => {
    const res: JsonResult = await apiHttp(Api.updateEventFinance, eventFinanceDto);
    return res;
  },
  // 根据事件id、财务Id获取企业财务信息比率信息
  getFinanceByFinanceId: async (financeRateInEventDto: FinanceRateInEventDto): Promise<JsonResult> => {
    const res: JsonResult = await apiHttp(Api.getFinanceByFinanceId, financeRateInEventDto);
    return res;
  },
  // 根据时间调取财务信息
  getCompanyFinanceByTime: async (financeInEventDto: FinanceInEventDto): Promise<JsonResult> => {
      const res: JsonResult = await apiHttp(ComApi.getCompanyFinanceByTime, financeInEventDto);
      return res;
  },
};